#include "PlayingField.h"

char *roomFile = "PrisonWalls.mesh";


PlayingField::PlayingField(char* name, Ogre::SceneManager* sm, Ogre::SceneNode* toAddTo){
	Ogre::Entity* room;
	room = sm->createEntity(name, roomFile);
	Ogre::SceneNode* myNode = toAddTo->createChildSceneNode();
	Ogre::SceneNode* tmpNode = myNode->createChildSceneNode();
	tmpNode->setScale(700,1400,700);
	tmpNode->pitch(Ogre::Degree(90));
	tmpNode->attachObject(room);
	myNode->setPosition(0, 0, 0);
	music = Mix_LoadMUS("sounds/RiotGamesMusic2.wav");
	Mix_PlayMusic(music,-1);
	isMusicPlaying = 1;
}

void PlayingField::updateState(){}

void PlayingField::alertToInput( const InputSet& input ){
	if(input.get(IS_A)){
		if(!lock){
			if(isMusicPlaying){
				Mix_HaltMusic();
				isMusicPlaying = 0;
			}
			else{
				Mix_PlayMusic(music, -1);
				isMusicPlaying = 1;
			}
			lock = 1;
		}
	}
	else{
		lock = 0;
	}
}
